package reference;

import org.junit.Test;

import java.util.function.Function;

/**
 * 数组引用
 * 格式：
 * 类型[] :: new;
 */
public class ArrayRefTest {
    @Test
    public void test() {
        Function<Integer, Employee[]> function = new Function<Integer, Employee[]>() {
            @Override
            public Employee[] apply(Integer length) {
                return new Employee[length];
            }
        };

        Function<Integer, Employee[]> function1 = Employee[]::new;
        Employee[] apply = function1.apply(64);
        System.out.println(apply.length); // 64
    }
}
